package com.jiyun.controller;

import com.jiyun.entity.Order;
import com.jiyun.entity.Reviews;
import com.jiyun.entity.Tavern;
import com.jiyun.entity.UserFavoriteHotels;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.jiyun.service.OrderService;

import java.util.List;


/**
 * (Order)表控制层
 *
 * @author LYT
 * @since 2025-02-13 09:01:59
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("findOrder")
    public List<Order> findOrder(@RequestParam(required = false) Integer userId){
        System.out.println("userId = " + userId);
        return orderService.findOrder(userId);
    }

    @GetMapping("findTavern")
    public List<Reviews> findTavern(@RequestParam Integer tavernId){
        System.out.println("tavernId = " + tavernId);
        return orderService.findTavern(tavernId);
    }

    @GetMapping("findLiKedTavern")
    public List<Tavern> findLiKedTavern(@RequestParam Integer userId){
        System.out.println("userId = " + userId);
        return orderService.findLiKedTavern(userId);
    }

}

